#include <iostream>

class Building;

class GoodGay
{
public:
    GoodGay();
    void visit();
    Building *building;
};

class Building
{
    friend class GoodGay;    // 类做友元
public:
    Building();
public:
    std::string m_SittingRoom;  // 客厅
private:
    std::string m_BedRoom;  // 卧室
};

// 类外写成员函数
Building::Building()
{
    m_SittingRoom = "sitting room";
    m_BedRoom = "bed room";
}

GoodGay::GoodGay()
{
    building = new Building();
}

void GoodGay::visit()
{
    std::cout<< "GoodGay is visit "<< building->m_SittingRoom << std::endl;
    std::cout<< "GoodGay is visit "<< building->m_BedRoom << std::endl;
}

void test01()
{
    GoodGay goodGay;
    goodGay.visit();
}

int main()
{
    test01();
    return 0;
}